bin_PROGRAMS=Hello_Java_Api_Client Hello_Java_Api_Server

Hello_Java_Api_Client_SOURCES=
Hello_Java_Api_Server_SOURCES=

CLIENT_OBJECTS=com/tipcj/demos/Hello_Java_Api_Client.class
SERVER_OBJECTS=com/tipcj/demos/Hello_Java_Api_Server.class
CLEANFILES=$(CLIENT_OBJECTS) $(SERVER_OBJECTS)

Hello_Java_Api_Client$(EXEEXT): $(CLIENT_OBJECTS)
	$(shell $(MKDIR_P) .libs)
	jar cfm $@.jar ./Manifest_client.txt -C .libs $(CLIENT_OBJECTS)
	tar cvfz $@.tar.gz $@.jar  -C ../../../tipcj .libs/libtipcj.jar .libs/libtipcj.so
	cp ../../../tipcj/.libs/libtipcj.jar ../../../tipcj/.libs/libtipcj.so .libs

com/tipcj/demos/%.class: %.java
	@echo "Compiling $<"
	$(shell $(MKDIR_P) .libs)
	$(shell javac -cp ../../../tipcj/.libs:.libs -d .libs $< )

Hello_Java_Api_Server$(EXEEXT): $(SERVER_OBJECTS)
	$(shell $(MKDIR_P) .libs)
	jar cfm $@.jar ./Manifest_server.txt -C .libs $(SERVER_OBJECTS)
	tar cvfz $@.tar.gz $@.jar -C ../../../tipcj .libs/libtipcj.jar .libs/libtipcj.so
	cp ../../../tipcj/.libs/libtipcj.jar ../../../tipcj/.libs/libtipcj.so .libs

clean-generic:
	rm -rf Hello_Java_Api_Client$(EXEEXT).jar Hello_Java_Api_Server$(EXEEXT).jar Hello_Java_Api_Client$(EXEEXT).tar.gz Hello_Java_Api_Server$(EXEEXT).tar.gz
